<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Honeydew管理介面</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<!-- Jquery -->
<script src="http://code.jquery.com/jquery.js"></script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
<link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/themes/smoothness/jquery-ui.css" />
<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.4/jquery-ui.min.js"></script>
<script src="${pageContext.request.contextPath}/js/jquery.blockUI.js"></script>
<!-- carousel -->
<link href="${pageContext.request.contextPath}/css/carousel.css" rel="stylesheet" />
<!-- Bootstrap -->
<link href="${pageContext.request.contextPath}/bootstrap-3.1.1-dist/css/bootstrap.min.css" rel="stylesheet" media="screen" />
<script src="${pageContext.request.contextPath}/bootstrap-3.1.1-dist/js/bootstrap.min.js"></script>
<!-- responsive -->
<link href="${pageContext.request.contextPath}/css/bootstrap-responsive.css" rel="stylesheet" type="text/css">
<!-- holder -->
<script src="${pageContext.request.contextPath}/holder/holder.js"></script>
<!-- commons -->
<link href="${pageContext.request.contextPath}/css/commons.css" rel="stylesheet" />

<!-- Manage -->
<script src="${pageContext.request.contextPath}/js/manage.js"></script>

</head>
<body>
<s:set var="theme" value="'simple'" scope="page" />
<s:form id="query_form" action="queryItemStock">
	<h1>商品庫存管理</h1>
	
	<table width="100%" height="100%">
		<tr>
			<td>
				<s:include value="manage_head.jsp" />
			</td>
		</tr>
		<tr>
			<td>
				<!-- 查詢條件 -->
				<table width="100%" class="table table-bordered">
					<tr>
						<!-- 必填 -->
						<th>商品編號</th>
						<td colspan="3">
							<s:textfield theme="simple" id="itemInformationQb.Number" name="itemInformationQb.Number" cssClass="require-field" />
						</td>
					</tr>
				</table>
				
				<div align="right">
					<span>
						<a href="<s:url action='executeCreateItemStock'>
						</s:url>">新增</a>
					</span>
					<s:submit id="queryBtn" cssClass="btn" value="查詢" />
				</div>
				
				<s:if test="%{itemStockList != null}">
					<table width="100%" class="table table-hover">
						<tr>
							<th>#</th>
							<th>商品顏色</th>
							<th>商品尺寸</th>
							<th>數量</th>
							<th>開始日期</th>
							<th>結束日期</th>
							<th>狀態</th>
							<th>功能</th>
						</tr>
						
						<s:iterator value="itemStockList" status="st">
							<tr>
								<td>
									<s:property value="#st.index + 1" />
									<s:hidden value="%{Seqid}" />
								</td>
								<td>
									<s:property value="Color" />
								</td>
								<td>
									<s:property value="Size" />
								</td>
								<td>
									<s:property value="Amount" />
								</td>
								<td>
									<s:property value="Startdate" />
								</td>
								<td>
									<s:property value="Enddate" />
								</td>
								<td>
									<s:property value="@lance.honeydew.util.ItemStockUtil@getStateStr(State)" />
								</td>
								<td>
									<a href="
									<s:url action='executeUpdateItemStock'>
										<s:param name='itemStockSeqId' value='Seqid' />
									</s:url>">修改</a>
									
									<input id="delete" class="btn" type="button" onclick="ajaxDeleteItemStock(<s:property value='Seqid' />);" value="刪除" />
								</td>
							</tr>
						</s:iterator>
					</table>
				</s:if>
			</td>
		</tr>
	</table>
	
</s:form>
</body>
</html>